package com.ww.scm.valueObject.croe;

import java.util.List;



public class ResponseEntity<T> extends ResponseInfo {
	
	public ResponseEntity() {
		super();
	}
	
	public ResponseEntity(String attributeName,List<T> attribute) {
		super();
		setEntity(attributeName,attribute);
	}
	
	public void setEntity(String attributeName,List<T> attribute){
		if (attribute.isEmpty()){
			return;
		}
		if (attribute.size()==1){
			dateMap.put(attributeName, attribute.iterator().next());
		}else if (attribute.size()>1){
			dateMap.put(attributeName, attribute);
		}
	}
	
	public void setEntity(String attributeName,T attribute){
		if (attribute!=null){
			dateMap.put(attributeName, attribute);
		}
	}
	
	public void setMaxRecordSizeValue(long maxRecordSize){
		dateMap.put("totalRecords", maxRecordSize);
	}

}
